<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "t_activity".
 *
 * @property int $id ID
 * @property string $name 活动名
 * @property string $startDate 开始日期
 * @property string $endDate 结束日期
 * @property int $status 状态
 * @property int $_intm 创建时间
 */
class TActivity extends \yii\db\ActiveRecord
{
    const STATUS_INIT       = 0;
    const STATUS_ACTIVE     = 1;
    const STATUS_DELETE     = 2;
    public static $dropdownFields = [
        'status' => [
            self::STATUS_INIT    => '审核中',
            self::STATUS_ACTIVE  => '有效',
            self::STATUS_DELETE  => '删除',
        ],
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 't_activity';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['startDate', 'endDate'], 'required'],
            [['startDate', 'endDate'], 'safe'],
            [['status', '_intm'], 'integer'],
            [['name'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '活动名',
            'startDate' => '开始日期',
            'endDate' => '结束日期',
            'status' => '状态',
            '_intm' => '创建时间',
        ];
    }
}
